package study01;

import java.util.Scanner;

public class Exercise03 {
    public static void main(String[] args) {
        System.out.println("请输入一串字符串：");
        Scanner sca = new Scanner(System.in);
        String str = sca.nextLine();
        int bigNum = 0;
        int smallNum = 0;
        int num = 0;
        for (int i = 0; i < str.length() ; i++) {
            if(str.charAt(i)>='A'&&str.charAt(i)<='Z'){
                bigNum+=1;
            } else if (str.charAt(i)>='a'&&str.charAt(i)<='z') {
                smallNum+=1;
            }else if(str.charAt(i)>='0'&&str.charAt(i)<='9'){
                num+=1;
            }
        }
        System.out.println("大写字母字符出现的次数是："+bigNum);
        System.out.println("小写字母字符出现的次数是："+smallNum);
        System.out.println("数字字符出现的次数是："+num);
    }
}
